package cn.edu.scau.cmi.limingben.client;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;


public class HibernateProgClient extends Application{
	public static void main(String[] args) {
//		getConn();
//		test();
		launch(args);
	}

//	private static void test(){
//		SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
//		Session session = sessionFactory.openSession();
//		session.beginTransaction();
//		List<Student> list = session.createQuery("from Student").list();
//		for (Student student : list) {
//			System.out.println(student.getName());
//		}
//		session.close();
//
//	}
//	private static Connection getConn() {
//	    String driver = "com.mysql.cj.jdbc.Driver";
//	    String url = "jdbc:mysql://localhost:3306/sa?serverTimezone=Asia/Shanghai";
//	    String username = "root";
//	    String password = "123456";
//	    Connection conn = null;
//	    try {
//	        Class.forName(driver);
//	        conn = (Connection) DriverManager.getConnection(url, username, password);
//	    } catch (ClassNotFoundException e) {
//	        e.printStackTrace();
//	    } catch (SQLException e) {
//	        e.printStackTrace();
//	    }
//	    return conn;
//	}

	@Override
	public void start(Stage primaryStage) throws Exception {
		FXMLLoader loader = new FXMLLoader(this.getClass().getResource("../hibernateprog/view/hibernateprog.fxml"));
		Parent parent = loader.load();
		primaryStage.setScene(new Scene(parent));
		primaryStage.setTitle("实验七 黎明奔");
		primaryStage.setResizable(false);
		primaryStage.show();
	}
}
